package com.hzw.saas.web.admin.hpc.param;

import java.util.List;
import javax.validation.Valid;
import javax.validation.constraints.*;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 *
 * </p>
 *
 * @author sonam
 * @since 2021/2/22 17:42
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel("超算中心配置添加参数")
public class HpcConfigAddParam {

    @ApiModelProperty(value = "连接类型", notes = "默认VPN")
    private String connType;

    @NotBlank(message = "超算中心名称不能为空")
    @ApiModelProperty(value = "超算中心名称", notes = "超算中心名称：例如 上海HPC", required = true)
    private String hpcName;

    @NotBlank(message = "超算中心desc不能为空")
    @ApiModelProperty(value = "超算中心", required = true)
    private String hpcDesc;

    @NotNull(message = "ip地址不能为空")
    @Pattern(regexp = "([1-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}", message = "请输入正确的ip地址")
    @ApiModelProperty(value = "ip地址", required = true)
    private String ip;

    @NotNull(message = "端口号不能为空")
    @Max(value = 65535, message = "请输入正确的端口号")
    @Min(value = 1, message = "请输入正确的端口号")
    @ApiModelProperty(value = "端口", required = true)
    private Integer port;

    @Valid
    @ApiModelProperty(value = "HPC商品选项")
    private List<HpcItemParam> hpcItemList;

}
